
<div class="row">
    <div class="col-md-5">
        <ul class="list-inline top30">
            <li class="col-md-3"><img src="assets/images/tags.png" alt="tag" height="200" width="110"/></li>
            <li class="col-md-9">
                <form ng-submit="handleObjectSubmit()" role="form" class="form-horizontal" autocomplete="off" novalidate>
                    <div class="form-group">
                        <label for="tagSelect" class="col-md-3 control-label">Tag Id:</label>
                        <div class="col-md-5">
                            <select ui-select2 name="tagSelect" id="tagSelect" ng-model="object.tag" class="form-control" required data-placeholder="Pick a tag">
                                <option value=""></option>
                                <option ng-repeat="tag in tags" value="{{tag}}">{{tag.number}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="objectName" class="col-md-3 control-label">Name:</label>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="objectName" placeholder="Enter name"
                                   ng-model="object.name" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="objectDescription" class="col-md-3 control-label">Description:</label>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="objectDescription"
                                   placeholder="Enter Description" ng-model="object.description">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="objectId" class="col-md-3 control-label">Objects' Id:</label>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="objectId" placeholder="Enter id" ng-model="object.objectId">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-default" ng-disabled="!(object.tag && object.name)">Save</button>
                        </div>
                    </div>
                </form></li>
        </ul>
        <div cg-busy="saveObjectPromise"></div>
    </div>
    <div class="col-md-7">
        <accordion>
            <accordion-group heading="Currently existing Objects">
                <div class="row">
                    <div class="form-group well object col-md-3" ng-repeat="object in objects">

                        <div class="row"><span class="col-md-6">Name:</span> <a href="#" editable-text="object.name" e-name="name" onaftersave="object.changed=true">{{ object.name || 'empty' }}</a></div>
                        <div class="row"><span class="col-md-6">Description:</span> <a href="#"  editable-text="object.description" onaftersave="object.changed=true">{{ object.description || 'empty' }}</a></div>
                        <div class="row"><span class="col-md-6">Object's Id:</span> <a href="#"  editable-text="object.objectId"onaftersave="object.changed=true">{{ object.objectId || 'empty' }}</a></div>
                        <div class="row"><span class="col-md-7">Object's tag id:</span> {{ object.tag.number || 'empty' }}</div>

                        <div class="buttons">
                            <div class="alerts pull-left">
                                <alert type="info" ng-show="object.saved">Successfully Saved</alert>
                                <alert type="danger" ng-show="object.error">Error. Please try again</alert>
                                <!--<div class="animate-show" ng-show="object.saved"><p class="bg-info">Saved Successfully</p></div>-->
                                <!--<div class="animate-show" ng-show="object.error"><p class="bg-danger" ></p></div>-->
                            </div>
                            <button type="button" class="btn btn-default pull-right" ng-click="saveObject(object)" ng-disabled="!object.changed">
                                Save
                            </button>
                        </div>
                    </div>
                </div>
            </accordion-group>
        </accordion>
    </div>
</div>



